#ifndef _U_TEXTEDIT_WIDGET_H_
#define _U_TEXTEDIT_WIDGET_H_

#include <QWidget>
class QTextEdit;
class QPushButton;
class UAddBookWidget;
class UQueryBookWidget;
class UDeleteBookWidget;
class UReviseBookWidget;
class UTextEditWidget  : public QWidget
{
	Q_OBJECT

public:
	UTextEditWidget(QWidget *parent);
	~UTextEditWidget();

private slots:
	void onSendButtonReleased();
	void onGetJsonButtonReleased();
	void onUpdataJsonButtonReleased();
	void onManageVersionButtonReleased();
	void onAddBooksButtonReleased();
	void onQueryBooksButtonReleased();
	void onDeleteBooksButtonReleased();
	void onReviseBooksButtonReleased();

private:signals:
	void sendText(const QString& text, bool isSelf = true);
	void getDefaultJson();

private:
	void initConnect();
	void initButton();
	QByteArray getObjectInfo();

	QTextEdit*   m_pTextEdit;
	QPushButton* m_pSendButton;
	QPushButton* m_pGetJsonButton;
	QPushButton* m_pUpdateJsonButton;
	QPushButton* m_pManageVersionButton;
	QPushButton* m_pAddBooksButton;
	QPushButton* m_pQueryBooksButton;
	QPushButton* m_pDeleteBooksButton;
	QPushButton* m_pReviseBooksButton;
	UAddBookWidget*		m_pAddBookWidget;
	UQueryBookWidget*	m_pQueryBookWidget;
	UDeleteBookWidget*  m_pDeleteBookWidget;
	UReviseBookWidget*  m_pReviseBookWidget;
};

#endif
